//2009/08/18 23:30:13
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class CustomerStatistics
{
public:
    vector <string> reportDuplicates(vector <string> customerNames)
    {
        set<string> v(customerNames.begin(), customerNames.end());
        vector<string> ret;
        set<string> :: iterator it;
        for (it=v.begin(); it!=v.end(); it++)
        {
            int total = 0;
            for (int j=0; j<customerNames.size(); j++)
            {
                if (customerNames[j].compare(*it) == 0) total ++;
            }
            if (total > 1)
            {
                stringstream s;
                s << (*it) << " " << total;
                ret.push_back(s.str());
            }
        }
        return ret;
    }
};
